The goal of the current proposal is to develop a new flexible framework for metagenomic assembly. This framework will provide novel algorithms for de novo and comparative assembly of metagenomic data, as well as tools for extracting and analyzing genomic variation. In addition, a novel approach will be developed for reconstructing segments of a genome containing a specific 16S rRNA sequence. At the core of this framework are two packages developed in the PIs lab: the open source package AMOS - a flexible and modular assembly package, and Bambus 2 - a genomic scaffolder specifically targeted at metagenomic data. A novel model-based testing framework will be closely integrated with the developments proposed here in order to ensure the correctness of the software being developed. Several levels of test procedures will be run every time the code is changed, on a nightly basis, as well as at regular intervals, allowing errors to be promptly discovered and corrected.